﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GoGoConsoleApp
{
    class Program
    {

        //4、子类：飞机、小鸟、超人
        //父类：交通工具、动物
        //接口

        static void Main(string[] args)
        {
            Superman superman = new Superman();
            TestEats(superman);
            TestIFlyable(superman);

            Bird bird = new Bird();
            TestEats(bird);
            TestIFlyable(bird);
            bird.LayEggs();

            Plane plane = new Plane();
            plane.CarryPassenge();
            TestIFlyable(plane);

        }

        static void TestEats(Animals animals) {
            animals.Eats();
        }
        static void TestCarryPassange(Vehicle vehicle) {
            vehicle.CarryPassenge();
        }
        static void TestIFlyable(IFlyable flyable) {
            flyable.TakeOff();
            flyable.Fly();
            flyable.Land();
        }
    }

    class Animals 
    {
        public void Eats() {
            Console.Write("我会吃！！！--");
        }
    }

    interface IFlyable 
    {
        void TakeOff();
        void Fly();

        void Land();
    }
    class Superman : Animals, IFlyable
    {
        public void TakeOff() {
            Console.Write("   超人起飞！宝~");
        }
        public void Fly() {
            Console.Write("   飞了");
        }
        public void Land(){
            Console.WriteLine("   着陆！！！");
            }
    }

    class Bird : Animals, IFlyable
    {
        public void LayEggs()
        {
            Console.WriteLine("   我会下蛋！！！--");
        }
        public void TakeOff()
        {
            Console.Write("   愤怒的小鸟起飞！宝~--");
        }
        public void Fly()
        {
            Console.Write("   飞了--");
        }
        public void Land()
        {
            Console.Write("   着陆！！！");
        }
    }

    class Vehicle 
    {
        public void CarryPassenge() {
            Console.Write("我能载一个地球村的人！！！--");
        }
    }
    class Plane : Vehicle, IFlyable
    {
        public void TakeOff()
        {
            Console.Write("   Spex号起飞！宝~--");
        }
        public void Fly()
        {
            Console.Write("   飞了--");
        }
        public void Land()
        {
            Console.WriteLine("着陆！！！");
        }
    }
}
